# coding: utf-8

from enum import unique

from common.constant import StatusEnum


@unique
class Message(StatusEnum):
    """
    add by zhouhl 2018-01-10
    七陌webcall接口返回的message标识
    """
    BUSY = (0, '线路繁忙')
    REJECT = (3, '被叫拒接/振铃未接/占线/关机/空号')
    CONNECTED = (4, '被叫已接听')
    NO_MONEY = (5, '余额不足')
    ERROR = (8, '线路异常')


@unique
class AnswerState(StatusEnum):
    """
    add by zhouhl 2018-01-10
    七陌通话状态事件推送中的State标识，即接听状态
    """
    DEALING = ('dealing', '已接')
    NOT_DEAL = ('notDeal', '振铃未接听')
    LEAK = ('leak', 'ivr放弃')
    QUEUE_LEAK = ('queueLeak', '排队放弃')
    BLACK_LIST = ('blackList', '黑名单')
    VOICEMAIL = ('voicemail', '留言')


@unique
class CallState(StatusEnum):
    """
    add by zhouhl 2018-01-10
    七陌通话状态事件推送中的CallState标识，即事件状态
    """
    RING = ('Ring', '呼叫振铃')
    RINGING = ('Ringing', '被呼振铃')
    LINK = ('Link', '接通')
    HANGUP = ('Hangup', '通话结束')
    UNLINK = ('Unlink', '通话结束')


@unique
class CallType(StatusEnum):
    """
    add by zhouhl 2018-01-10
    七陌通话状态事件推送中的CallType标识，即通话类型
    """
    DIALOUT = ('dialout', '外呼通话')
    NORMAL = ('normal', '普通来电')
    TRANSFER = ('transfer', '转接电话')
    DIAL_TRANSFER = ('dialTransfer', '外呼转接')


SEVEN_MOOR_RECORD_KEY = 'seven_moor_{call_sheet_id}'
